package com.snopy.designPattern.chainOfResponsibility.impl;

import com.snopy.designPattern.chainOfResponsibility.inter.Middleware;
import lombok.extern.slf4j.Slf4j;

/**
 * @author snopy
 * @version 1.0.0
 * @classname RoleCheckMiddleware
 * @description
 * @email 77912204@qq.com
 * @date 2022/03/04 13:20
 */
@Slf4j
public class RoleCheckMiddleware extends Middleware {
    @Override
    public boolean check(String username, String password) {
        if (username.equals("admin@gmail.com")){
            log.info("hello admin");
            return true;
        }
        log.info("hello! user!");
        return checkNext(username,password);
    }
}
